package com.gdcn.zb.sys.dao.impl;

import java.util.List;

import com.gdcn.zb.base.BaseDao;
import com.gdcn.zb.base.exception.DaoException;
import com.gdcn.zb.sys.dao.ISummaryDao;
import com.gdcn.zb.sys.valueobject.Summary;

public class SummaryDaoHibernate extends BaseDao implements ISummaryDao {

	@Override
	protected Class getModelClass() {
		return Summary.class;
	}

	public void createSummary(Summary summary) throws DaoException {
		super.doCreateObject(summary);
	}

	public void deleteSummary(Summary summary) throws DaoException {
		super.doDeleteObject(summary);

	}
	
	public void deleteSummary(int id) throws DaoException {
		super.doDeleteObject(id);	
	}

	public Summary findSummaryById(int id) throws DaoException {
		return (Summary)super.doFindObjectById(id);
	}

	public void updateSummary(Summary summary) throws DaoException {
		super.doUpdateObject(summary);
	}

	public List<Summary> listSummaryByUser(String userId) throws DaoException {
		return super.doFind("from Summary s where s.userId='"+userId+"'");
	}

}
